home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
_F_ERROR.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
4KB
|
130 lines
*' $Header: E:/test/sysproc/doc/_f_error.prv 1.0 12 Aug 1992 16:56:06 Bill Ramos $
PROCEDURE _F_Error
*-------------------------------------------------------------------------------
* NAME
* _F_Error
*
* DESCRIPTION
* Error routine called by Multi-file and Edit forms. Also used by
* Design surface programs.
*
* SYNOPSIS
* DO _F_Error
*
* PARAMETERS
* None
*
* DEPENDENCIES
* fxl_edit = Edit or M-D form, .T. if EDIT, .F. if M-D form
* fxl_error = Global, pass to calling program .T. if error occured
* gl_append = M-D form, .T. performing append on the master file
* gl_appendc = M-D form, .T. performing append on detail file
* gn_recno = M-D form, record # before attempting append operation
* gl_draw = M-D form, .T. means redraw on return, .F. don't
* ll_samerec = M-D form, .T. means on the same record, .F. not
*
* VARIABLES
* ln_error = Error number returned by ERROR()
*
*-------------------------------------------------------------------------------
PRIVATE ln_error, ll_ans, ln_mssg, lc_mssg
ln_error = ERROR()
DO CASE
*-- Form run time error, more than one user appending
CASE ( (TYPE("gl_append") = "L" .AND. gl_append) .OR.;
(TYPE("gl_appendc") = "L" .AND. gl_appendc)).AND. ;
(ln_error = 108 .OR. ln_error = 372)
lc_mssg = [ Another user is appending. Retry?]
ln_mssg = LEN(lc_mssg)
ll_ans = _NodShake(lc_mssg,5,17,1,ln_mssg + 2,.F.)
IF ll_ans
RETRY
ELSE
GO gn_recno
IF .NOT. COMPLETED()
ROLLBACK
ENDIF
ENDIF
CASE (ln_error = 108 .OR. ln_error = 372) && Record or File lock error
lc_mssg = [ File in use by ] +;
IIF( ISBLANK( LKSYS(2) ), [another], LKSYS(2)) + ;
[. Retry?]
ln_mssg = LEN(lc_mssg)
ll_ans = _NodShake(lc_mssg,5,17,1,ln_mssg + 2,.F.)
IF ll_ans
RETRY
ELSE
IF TYPE( "gl_draw" ) <> "U" && If a M-D form
GO gn_recno
IF .NOT. COMPLETED()
ROLLBACK
ENDIF
ELSE
RELEASE FXL_Error
PUBLIC FXL_Error
FXL_Error = .T. && Indicate error handler call
RETURN
ENDIF
ENDIF
OTHERWISE && Critical Error - Return to CC
RELEASE FXL_Error
PUBLIC FXL_Error
FXL_Error = .T. && Indicate error handler call
DO _Err_Box WITH Message()
IF TYPE("FXL_EDIT") = "L" .AND. FXL_EDIT
KEYBOARD "{27}"
ENDIF
IF TYPE("FXL_EDIT") = "L" .AND. .NOT. FXL_EDIT
*-- Start clearing .dbf out of all other workareas past 1
IF .NOT. COMPLETED()
ROLLBACK
ENDIF
CLOSE DATABASES
IF .NOT. ISBLANK( fxc_mastdb )
DO _OpenDBF WITH fxc_mastdb, 1, .T.
ENDIF
SET CURSOR ON
RELEASE FXL_Edit, FXL_Error
IF fxl_isscb .AND. fxc_dbtrap = "ON"
SET DBTRAP ON
ENDIF
RELEASE FXC_ctag
DO _FXEcREnv && Reset the operating environment
RELEASE fxl_escape, fxl_exact, fxl_fields, fxl_near, fxl_safety, ;
fxc_dbtrap, fxl_isscb, fxc_mastdb, fxl_talk
ON ERROR
RETURN TO MASTER
ENDIF
ENDCASE
ll_samerec = .T.
gl_draw = .F.
RETURN
*-- EOP: _F_Error
*'-------------------------------------------------------------------------
*' $Log: E:/test/sysproc/doc/_f_error.prv $
*'-------------------------------------------------------------------------